package com.shanzmoo.stm.admin.manager;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.shanzmoo.db.store.entity.StoreMemberEntity;
import com.shanzmoo.db.store.service.IStoreMemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 系统用户管理
 *
 * @author： Gzhao 2021/3/10
 */
@Slf4j
@Component
public class SysUserManager {

    @Autowired
    private IStoreMemberService storeMemberService;

    public StoreMemberEntity getUserByName(String username) {
        return storeMemberService.getOne(
                new QueryWrapper<StoreMemberEntity>()
                        .eq("mobile", username)
                        .eq("deleted", false)
        );
    }
}
